package edu.hubu.book.domain;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.io.Serializable;

/**
 * 加注解是为了解决请求时必须所有参数都有值才会执行成功，否则会报415或者400畸形语法
 * 作用：初始化类，传参时覆盖所需的参数
 */
@Component
public class BookClass implements Serializable {
    //一级分类id
    @Value("0")
    private int sid;
    //一级分类名称
    @Value("")
    private String firstClassName;
    //一级分类描述
    @Value("")
    private String description;
    //二级分类id
    @Value("0")
    private int ssid;
    //从属一级分类id
    @Value("0")
    private int firstId;
    //二级分类名称
    @Value("")
    private String secondClassName;



    public int getSid() {
        return sid;
    }

    @Override
    public String toString() {
        return "book{" +
                "sid=" + sid +
                ", firstClassName='" + firstClassName + '\'' +
                ", ssid=" + ssid +
                ", firstId=" + firstId +
                ", secondClassName='" + secondClassName + '\'' +
                ", description='" + description + '\'' +
                '}';
    }

    public void setSid(int sid) {
        this.sid = sid;
    }

    public String getFirstClassName() {
        return firstClassName;
    }

    public void setFirstClassName(String firstClassName) {
        this.firstClassName = firstClassName;
    }

    public int getSsid() {
        return ssid;
    }

    public void setSsid(int ssid) {
        this.ssid = ssid;
    }

    public int getFirstId() {
        return firstId;
    }

    public void setFirstId(int firstId) {
        this.firstId = firstId;
    }

    public String getSecondClassName() {
        return secondClassName;
    }

    public void setSecondClassName(String secondClassName) {
        this.secondClassName = secondClassName;
    }



    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
